package com.yhn.registration.service.impl;

import com.hospital.common.pojo.TDepartment;
import com.hospital.common.pojo.TDoctorInfo;
import com.hospital.common.pojo.TDoctorSchedule;
import com.yhn.registration.mapper.DepartmentMapper;
import com.yhn.registration.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {
    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public List<TDepartment> listAll() {
        return departmentMapper.listAll();
    }

    @Override
    public List<TDoctorInfo> doctor() {
        return departmentMapper.doctor();
    }

    @Override
    public List<TDoctorInfo> doctorByDept(Long deptId) {
        return departmentMapper.doctorByDept(deptId);
    }

    @Override
    public List<TDoctorInfo> getDoctorByName(String name) {
        return departmentMapper.getDoctorByName(name);
    }

    @Override
    public List<TDoctorSchedule> getDoctorSchedule(Long doctorId) {
        return departmentMapper.getDoctorSchedule(doctorId);
    }

    @Override
    public List<TDoctorInfo> doctorsByDeptAndSchedule(Long deptId, String date, Integer hourSlot) {
        return departmentMapper.doctorsByDeptAndSchedule(deptId, date, hourSlot);
    }


    @Override
    public String getDoctorNameByInfoId(Long infoId) {
        return departmentMapper.getDoctorNameByInfoId(infoId);
    }

    @Override
    public Long getUserIdByInfoId(Long infoId) {
        return departmentMapper.getUserIdByInfoId(infoId);
    }
}


